package cn.iocoder.yudao.module.acm.dal.mysql.servicesupplydistplan;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.acm.controller.admin.servicesupplydistplan.vo.ServiceSupplyDistPlanPageReqVO;
import cn.iocoder.yudao.module.acm.dal.dataobject.servicesupplydistplan.ServiceSupplyDistPlanDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 机供品餐具配送计划 Mapper
 *
 * @author yisl
 */
@Mapper
public interface ServiceSupplyDistPlanMapper extends BaseMapperX<ServiceSupplyDistPlanDO> {

    default PageResult<ServiceSupplyDistPlanDO> selectPage(ServiceSupplyDistPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ServiceSupplyDistPlanDO>()
                .likeIfPresent(ServiceSupplyDistPlanDO::getPlanCode, reqVO.getPlanCode())
                .likeIfPresent(ServiceSupplyDistPlanDO::getFlightNo, reqVO.getFlightNo())
                .eqIfPresent(ServiceSupplyDistPlanDO::getDistStatus, reqVO.getDistStatus())
                .geIfPresent(ServiceSupplyDistPlanDO::getStartDate, reqVO.getStartDate())
                .leIfPresent(ServiceSupplyDistPlanDO::getEndDate, reqVO.getEndDate())
                .orderByDesc(ServiceSupplyDistPlanDO::getId));
    }

}